﻿using TrinityEngine;
using TrinityEngine.SceneManagement;

public class SpriteBatcherTestScene : SceneBuilder
{
    private Sprite _sprite;

    public SpriteBatcherTestScene()
    {
         _sprite = new Sprite(new Texture("res/textures/3.png"), new Rect(0, 0, 300, 300), 300);
    }

    public override Scene Build()
    {
        Scene scene = new Scene("Sprite Batcher Test");

        for (int i = 0; i < 1000; i++)
        {
            scene.AddGameObject(new SpriteBatcherTest(_sprite, new OpenTK.Mathematics.Vector3(TrinityEngine.Random.value, TrinityEngine.Random.value, TrinityEngine.Random.value) * 10f));
        }

        return scene;
    }

    protected override void Dispose(bool disposing)
    {
        if (_disposed)
        {
            return;
        }

        if (disposing)
        {

        }

        _sprite.Dispose();

        base.Dispose(disposing);
    }
}

